From: Richard M. Stallman Date: Sat, 15 May 1993 19:00:34 +0000 (+0000) Subject: (Fx_selection_exists_p): Handle nil, t as SELECTION arg. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~96263 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=356ba514a3cfc4a11c031fdce4c6bb81c4ed5ae3;p=emacs.git (Fx_selection_exists_p): Handle nil, t as SELECTION arg. Don't die if SELECTION is not recognized. --- diff --git a/src/xselect.c b/src/xselect.c index bb052ae1ccf..ca756646cd0 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -1679,12 +1679,18 @@ and t is the same as `SECONDARY'.)") Lisp_Object selection; { Window owner; + Atom atom; Display *dpy = x_current_display; CHECK_SYMBOL (selection, 0); if (!NILP (Fx_selection_owner_p (selection))) return Qt; + if (EQ (selection, Qnil)) selection = QPRIMARY; + if (EQ (selection, Qt)) selection = QSECONDARY; + atom = symbol_to_x_atom (dpy, selection); + if (atom == 0) + return Qnil; BLOCK_INPUT; - owner = XGetSelectionOwner (dpy, symbol_to_x_atom (dpy, selection)); + owner = XGetSelectionOwner (dpy, atom); UNBLOCK_INPUT; return (owner ? Qt : Qnil); }